home *** CD-ROM | disk | FTP | other *** search
/ Digitalfoto 118 / Digitalfoto 118.iso / mac / programas / 00 / start.swf / scripts / frame_1 / DoAction_3.as < prev    next >
Text File  |  2009-11-16  |  15KB  |  418 lines

  1. function renderMovie(file, movie_name)
  2. {
  3.    calculateCurrentVideo(file);
  4.    if(file.indexOf("http") != -1 or file.indexOf("rtmp") != -1)
  5.    {
  6.       movieURL_active = file;
  7.    }
  8.    else
  9.    {
  10.       movieURL_active = fsp_path + moviepath_info + file;
  11.    }
  12.    video_mode = true;
  13.    toolbar_mode = false;
  14.    content_pos_mc.bottom_mc._visible = false;
  15.    hideBacktoVideoButton();
  16.    content_pos_mc.video_mc.setLocalPos();
  17.    content_pos_mc.video_mc._visible = true;
  18.    if(full_video_mode_display == "true")
  19.    {
  20.       content_pos_mc.tab_navigation_mc._visible = false;
  21.    }
  22.    i = 0;
  23.    while(i < used_tab_arr.length)
  24.    {
  25.       content_pos_mc.tab_navigation_mc["tab_item_mc" + i].tab_navigation_item_active_mc._visible = false;
  26.       content_pos_mc.tab_navigation_mc["tab_item_mc" + i].enabled = true;
  27.       if(used_tab_arr[i][2])
  28.       {
  29.          content_pos_mc.content_mc[used_tab_arr[i][1]].setVisibility(false);
  30.       }
  31.       i++;
  32.    }
  33.    if(file.lastIndexOf("/") > -1)
  34.    {
  35.       current_swf = file.substring(file.lastIndexOf("/") + 1,file.lastIndexOf("."));
  36.    }
  37.    else
  38.    {
  39.       current_swf = file.substring(0,file.lastIndexOf("."));
  40.    }
  41.    content_pos_mc.video_mc.buildOverview();
  42.    content_pos_mc.video_mc.refreshMovieNavigation();
  43.    content_pos_mc.video_mc.buildMovieInfo();
  44.    content_pos_mc.video_mc.resetBookmarks();
  45.    content_pos_mc.video_mc.removeVideoBuffer();
  46.    content_pos_mc.video_mc.removeVideoInit();
  47.    playVideo(movieURL_active);
  48.    setPos();
  49. }
  50. function renderNextMovie(file, movie_name)
  51. {
  52.    if(file.indexOf("http") != -1 or file.indexOf("rtmp") != -1)
  53.    {
  54.       movieURL_active = file;
  55.    }
  56.    else
  57.    {
  58.       movieURL_active = fsp_path + moviepath_info + file;
  59.    }
  60.    if(file.lastIndexOf("/") > -1)
  61.    {
  62.       current_swf = file.substring(file.lastIndexOf("/") + 1,file.lastIndexOf("."));
  63.    }
  64.    else
  65.    {
  66.       current_swf = file.substring(0,file.lastIndexOf("."));
  67.    }
  68.    content_pos_mc.video_mc.bookmark_window_mc.removeMovieClip();
  69.    content_pos_mc.video_mc.cover_btn._visible = false;
  70.    content_pos_mc.video_mc.buildOverview();
  71.    content_pos_mc.video_mc.refreshMovieNavigation();
  72.    content_pos_mc.video_mc.buildMovieInfo();
  73.    content_pos_mc.video_mc.resetBookmarks();
  74.    content_pos_mc.video_mc.removeVideoBuffer();
  75.    content_pos_mc.video_mc.removeVideoInit();
  76.    playVideo(movieURL_active);
  77. }
  78. function renderToolbarMovie(file, movie_name)
  79. {
  80.    calculateCurrentVideo(file);
  81.    if(file.indexOf("http") != -1 or file.indexOf("rtmp") != -1)
  82.    {
  83.       movieURL_active = file;
  84.    }
  85.    else
  86.    {
  87.       movieURL_active = fsp_path + moviepath_info + file;
  88.    }
  89.    video_mode = true;
  90.    toolbar_mode = true;
  91.    content_pos_mc.bottom_mc._visible = false;
  92.    hideBacktoVideoButton();
  93.    content_pos_mc.video_mc.setLocalPos();
  94.    content_pos_mc.video_mc._visible = true;
  95.    if(full_video_mode_display == "true")
  96.    {
  97.       content_pos_mc.tab_navigation_mc._visible = false;
  98.    }
  99.    i = 0;
  100.    while(i < used_tab_arr.length)
  101.    {
  102.       content_pos_mc.tab_navigation_mc["tab_item_mc" + i].tab_navigation_item_active_mc._visible = false;
  103.       content_pos_mc.tab_navigation_mc["tab_item_mc" + i].enabled = true;
  104.       if(used_tab_arr[i][2])
  105.       {
  106.          content_pos_mc.content_mc[used_tab_arr[i][1]].setVisibility(false);
  107.       }
  108.       i++;
  109.    }
  110.    if(file.lastIndexOf("/") > -1)
  111.    {
  112.       current_swf = file.substring(file.lastIndexOf("/") + 1,file.lastIndexOf("."));
  113.    }
  114.    else
  115.    {
  116.       current_swf = file.substring(0,file.lastIndexOf("."));
  117.    }
  118.    content_pos_mc.video_mc.buildOverview();
  119.    content_pos_mc.video_mc.refreshMovieNavigation();
  120.    content_pos_mc.video_mc.buildMovieInfo();
  121.    content_pos_mc.video_mc.removeVideoBuffer();
  122.    content_pos_mc.video_mc.removeVideoInit();
  123.    playVideo(movieURL_active);
  124.    setPos();
  125. }
  126. function renderVideoBookmark(_chapter_node, _file, _movie_name, _timecode)
  127. {
  128.    parseVideo(_chapter_node);
  129.    _root.calculateCurrentVideo(_file);
  130.    if(_file.indexOf("http") != -1 or _file.indexOf("rtmp") != -1)
  131.    {
  132.       movieURL_active = _file;
  133.    }
  134.    else
  135.    {
  136.       movieURL_active = fsp_path + moviepath_info + _file;
  137.    }
  138.    video_mode = true;
  139.    toolbar_mode = false;
  140.    play_all_mode = false;
  141.    content_pos_mc.bottom_mc._visible = false;
  142.    hideBacktoVideoButton();
  143.    content_pos_mc.video_mc.setLocalPos();
  144.    content_pos_mc.video_mc._visible = true;
  145.    if(full_video_mode_display == "true")
  146.    {
  147.       content_pos_mc.tab_navigation_mc._visible = false;
  148.    }
  149.    i = 0;
  150.    while(i < used_tab_arr.length)
  151.    {
  152.       content_pos_mc.tab_navigation_mc["tab_item_mc" + i].tab_navigation_item_active_mc._visible = false;
  153.       content_pos_mc.tab_navigation_mc["tab_item_mc" + i].enabled = true;
  154.       if(used_tab_arr[i][2])
  155.       {
  156.          content_pos_mc.content_mc[used_tab_arr[i][1]].setVisibility(false);
  157.       }
  158.       i++;
  159.    }
  160.    if(file.lastIndexOf("/") > -1)
  161.    {
  162.       current_swf = _file.substring(_file.lastIndexOf("/") + 1,_file.lastIndexOf("."));
  163.    }
  164.    else
  165.    {
  166.       current_swf = _file.substring(0,_file.lastIndexOf("."));
  167.    }
  168.    content_pos_mc.video_mc.buildOverview();
  169.    content_pos_mc.video_mc.refreshMovieNavigation();
  170.    content_pos_mc.video_mc.buildMovieInfo();
  171.    content_pos_mc.video_mc.resetBookmarks();
  172.    content_pos_mc.video_mc.removeVideoBuffer();
  173.    content_pos_mc.video_mc.removeVideoInit();
  174.    content_pos_mc.video_mc.resetVcore();
  175.    clearInterval(load_delay);
  176.    load_delay = setTimeout(content_pos_mc.video_mc.loadVideo,200,movieURL_active,_timecode);
  177.    setPos();
  178. }
  179. function renderInlayVideo(file, __smoothing)
  180. {
  181.    content_pos_mc._visible = false;
  182.    inline_video_mode = true;
  183.    bg_mc._alpha = 35;
  184.    special_pos_mc._x = 0;
  185.    special_pos_mc._y = 0;
  186.    bg_mc.onRelease = function()
  187.    {
  188.       killInlayVideo();
  189.    };
  190.    special_pos_mc.attachMovie("inlay_video_mc","inlay_video_mc",2);
  191.    special_pos_mc.inlay_video_mc.__smoothing = __smoothing;
  192.    if(file.indexOf("http") != -1 or file.indexOf("rtmp") != -1)
  193.    {
  194.       special_pos_mc.inlay_video_mc.current_video_url = file;
  195.    }
  196.    else
  197.    {
  198.       special_pos_mc.inlay_video_mc.current_video_url = fsp_path + folder + file;
  199.    }
  200.    inlay_video_mc_x = Math.round(Stage.width / 2 - (Number(inlay_player_width) + 40) / 2);
  201.    inlay_video_mc_y = Math.round(Stage.height / 2 - (Number(inlay_player_height) + 85) / 2);
  202.    if(inlay_video_mc_x <= 0)
  203.    {
  204.       inlay_video_mc_x = 0;
  205.    }
  206.    if(inlay_video_mc_y <= 0)
  207.    {
  208.       inlay_video_mc_y = 0;
  209.    }
  210.    special_pos_mc.inlay_video_mc._x = inlay_video_mc_x;
  211.    special_pos_mc.inlay_video_mc._y = inlay_video_mc_y;
  212. }
  213. function killMovie()
  214. {
  215.    clearInterval(load_delay);
  216.    clearInterval(content_pos_mc.video_mc.init_vcore_delay);
  217.    content_pos_mc.video_mc._visible = false;
  218.    video_mode = false;
  219.    setPos();
  220.    content_pos_mc.bottom_mc._visible = true;
  221.    content_pos_mc.video_mc.cover_btn._visible = false;
  222.    content_pos_mc.video_mc.removeVideoBuffer();
  223.    content_pos_mc.video_mc.removeVideoInit();
  224.    content_pos_mc.video_mc.bookmark_window_mc.removeMovieClip();
  225.    content_pos_mc.video_mc.resetVcore();
  226.    play_all_mode = false;
  227.    content_pos_mc.tab_navigation_mc._visible = true;
  228.    renderContent(last_visible_content);
  229. }
  230. function killInlayVideo()
  231. {
  232.    content_pos_mc._visible = true;
  233.    bg_mc._alpha = 100;
  234.    inline_video_mode = false;
  235.    delete bg_mc.onRelease;
  236.    special_pos_mc.dark_mc.removeMovieClip();
  237.    special_pos_mc.inlay_video_mc.removeMovieClip();
  238. }
  239. function findParentVideoNode(video_index)
  240. {
  241.    var _loc3_ = video_index.split(".");
  242.    if(_loc3_.length > 0 && isNaN(Number(_loc3_[_loc3_.length - 1])))
  243.    {
  244.       _loc3_.splice(_loc3_.length - 1,1);
  245.    }
  246.    var _loc4_ = _root.cd_content.firstChild;
  247.    if(_loc3_.length > 1)
  248.    {
  249.       var _loc2_ = 0;
  250.       while(_loc2_ < _loc3_.length - 1)
  251.       {
  252.          _loc4_ = _loc4_.childNodes[_loc3_[_loc2_] - 1];
  253.          _loc2_ = _loc2_ + 1;
  254.       }
  255.    }
  256.    var _loc5_ = _loc4_.childNodes[_loc3_[_loc3_.length - 1] - 1];
  257.    return {parent_node:_loc4_,child_node:_loc5_};
  258. }
  259. function calculateCurrentVideo(arg)
  260. {
  261.    i = 0;
  262.    while(i < video_data.length)
  263.    {
  264.       if(video_data[i].attributes.movie == arg)
  265.       {
  266.          current_video = i;
  267.       }
  268.       i++;
  269.    }
  270. }
  271. function parseVideo(xmlNode)
  272. {
  273.    video_data = new Array();
  274.    var _loc1_ = 0;
  275.    while(_loc1_ < xmlNode.childNodes.length)
  276.    {
  277.       if(xmlNode.childNodes[_loc1_].attributes.type == "movie" and xmlNode.childNodes[_loc1_].attributes.cd > 0)
  278.       {
  279.          video_data.push(xmlNode.childNodes[_loc1_]);
  280.       }
  281.       _loc1_ = _loc1_ + 1;
  282.    }
  283. }
  284. function parseVideoPlayAll(xmlNode)
  285. {
  286.    if(xmlNode.hasChildNodes())
  287.    {
  288.       var _loc1_ = 0;
  289.       while(_loc1_ < xmlNode.childNodes.length)
  290.       {
  291.          if(xmlNode.childNodes[_loc1_].attributes.type == "movie")
  292.          {
  293.             if(xmlNode.childNodes[_loc1_].attributes.cd > 0)
  294.             {
  295.                video_data.push(xmlNode.childNodes[_loc1_]);
  296.             }
  297.          }
  298.          parseVideoPlayAll(xmlNode.childNodes[_loc1_]);
  299.          _loc1_ = _loc1_ + 1;
  300.       }
  301.    }
  302. }
  303. function playVideo(url)
  304. {
  305.    content_pos_mc.video_mc.resetVcore();
  306.    clearInterval(load_delay);
  307.    load_delay = setTimeout(content_pos_mc.video_mc.loadVideo,200,url);
  308. }
  309. function playAll()
  310. {
  311.    current_video = 0;
  312.    video_data = new Array();
  313.    parseVideoPlayAll(_root.cd_content);
  314.    play_all_max = video_data.length;
  315.    play_all_mode = true;
  316.    renderMovie(video_data[current_video].attributes.movie,video_data[current_video].attributes.name);
  317. }
  318. function playAllChapter(xmlNode)
  319. {
  320.    current_video = 0;
  321.    parseVideo(xmlNode);
  322.    play_all_max = video_data.length;
  323.    play_all_mode = true;
  324.    renderMovie(video_data[current_video].attributes.movie,video_data[current_video].attributes.name);
  325. }
  326. function pauseMovie()
  327. {
  328.    clearInterval(load_delay);
  329.    content_pos_mc.video_mc._visible = false;
  330.    content_pos_mc.video_mc.removeVideoBuffer();
  331.    content_pos_mc.video_mc.removeVideoInit();
  332.    content_pos_mc.video_mc.flv_player.pause();
  333.    content_pos_mc.video_mc.bookmark_window_mc.removeMovieClip();
  334.    content_pos_mc.video_mc.cover_btn._visible = false;
  335.    video_mode = false;
  336.    setPos();
  337.    content_pos_mc.bottom_mc._visible = true;
  338.    content_pos_mc.tab_navigation_mc.attachMovie("tab_navigation_bg_mc","back_to_video_bg_mc",content_pos_mc.tab_navigation_mc.getNextHighestDepth());
  339.    content_pos_mc.tab_navigation_mc.back_to_video_bg_mc._visible = false;
  340.    content_pos_mc.tab_navigation_mc.back_to_video_bg_mc._height = 25;
  341.    content_pos_mc.tab_navigation_mc.attachMovie("back_to_video_btn_mc","back_to_video_btn_mc",content_pos_mc.tab_navigation_mc.getNextHighestDepth());
  342.    content_pos_mc.tab_navigation_mc.back_to_video_btn_mc._visible = false;
  343.    content_pos_mc.tab_navigation_mc.back_to_video_btn_mc.text_op._x = 20;
  344.    content_pos_mc.tab_navigation_mc.back_to_video_btn_mc.text_op.autoSize = true;
  345.    content_pos_mc.tab_navigation_mc.back_to_video_btn_mc.text_op.textColor = parseColor(tabnavigator_text_color);
  346.    content_pos_mc.tab_navigation_mc.back_to_video_btn_mc.text_op.text = b2v_button_rollover_text.toUpperCase();
  347.    content_pos_mc.tab_navigation_mc.back_to_video_btn_mc.updown_symbol_mc.symbol.textColor = parseColor(tabnavigator_text_color);
  348.    content_pos_mc.tab_navigation_mc.back_to_video_btn_mc.btn_bg_mc._width = Math.round(content_pos_mc.tab_navigation_mc.back_to_video_btn_mc.text_op.textWidth + 67);
  349.    content_pos_mc.tab_navigation_mc.back_to_video_btn_mc.btn_rollover_mc._visible = false;
  350.    content_pos_mc.tab_navigation_mc.back_to_video_btn_mc.updown_symbol_mc._x = content_pos_mc.tab_navigation_mc.back_to_video_btn_mc.btn_bg_mc._width - 30;
  351.    content_pos_mc.tab_navigation_mc.back_to_video_btn_mc.updown_symbol_mc._alpha = 50;
  352.    drawBox(content_pos_mc.tab_navigation_mc.back_to_video_btn_mc.btn_rollover_mc,content_pos_mc.tab_navigation_mc.back_to_video_btn_mc.btn_bg_mc._width,23,parseColor(tabnavigator_rollover_color),parseColor(tabnavigator_rollover_color),100,100,"linear");
  353.    content_pos_mc.tab_navigation_mc.back_to_video_btn_mc._x = Math.round(content_pos_mc.tab_navigation_mc._x + content_pos_mc.tab_navigation_mc._width);
  354.    content_pos_mc.tab_navigation_mc.back_to_video_btn_mc._y = 2;
  355.    content_pos_mc.tab_navigation_mc.back_to_video_bg_mc._width = Math.round(content_pos_mc.tab_navigation_mc.back_to_video_btn_mc._width + 3);
  356.    content_pos_mc.tab_navigation_mc.back_to_video_bg_mc._x = content_pos_mc.tab_navigation_mc.back_to_video_btn_mc._x - 2;
  357.    content_pos_mc.tab_navigation_mc.back_to_video_btn_mc.onRollOver = function()
  358.    {
  359.       this.btn_rollover_mc._visible = true;
  360.    };
  361.    content_pos_mc.tab_navigation_mc.back_to_video_btn_mc.onRollOut = function()
  362.    {
  363.       this.btn_rollover_mc._visible = false;
  364.    };
  365.    content_pos_mc.tab_navigation_mc.back_to_video_btn_mc.onRelease = function()
  366.    {
  367.       continueVideo();
  368.    };
  369.    showBacktoVideoButton();
  370. }
  371. function continueVideo()
  372. {
  373.    content_pos_mc.bottom_mc._visible = false;
  374.    destroyBacktoVideoButton();
  375.    video_mode = true;
  376.    i = 0;
  377.    while(i < used_tab_arr.length)
  378.    {
  379.       content_pos_mc.tab_navigation_mc["tab_item_mc" + i].tab_navigation_item_active_mc._visible = false;
  380.       content_pos_mc.tab_navigation_mc["tab_item_mc" + i].enabled = true;
  381.       if(used_tab_arr[i][2])
  382.       {
  383.          content_pos_mc.content_mc[used_tab_arr[i][1]].setVisibility(false);
  384.       }
  385.       i++;
  386.    }
  387.    content_pos_mc.video_mc.setLocalPos();
  388.    content_pos_mc.video_mc._visible = true;
  389.    content_pos_mc.video_mc.flv_player.play();
  390.    setPos();
  391. }
  392. function showBacktoVideoButton()
  393. {
  394.    clearInterval(back_to_video_destroy_delay);
  395.    b2v_bg_target_pos_y = content_pos_mc.tab_navigation_mc.back_to_video_bg_mc._y;
  396.    b2v_btn_target_pos_y = content_pos_mc.tab_navigation_mc.back_to_video_btn_mc._y;
  397.    content_pos_mc.tab_navigation_mc.back_to_video_bg_mc._y = 30;
  398.    content_pos_mc.tab_navigation_mc.back_to_video_btn_mc._y = 30;
  399.    content_pos_mc.tab_navigation_mc.back_to_video_bg_mc._visible = true;
  400.    content_pos_mc.tab_navigation_mc.back_to_video_btn_mc._visible = true;
  401.    content_pos_mc.tab_navigation_mc.back_to_video_bg_mc.stopTween();
  402.    content_pos_mc.tab_navigation_mc.back_to_video_btn_mc.stopTween();
  403.    content_pos_mc.tab_navigation_mc.back_to_video_bg_mc.tween(["_y"],b2v_bg_target_pos_y,0.5,"easeOutQuart",0.3);
  404.    content_pos_mc.tab_navigation_mc.back_to_video_btn_mc.tween(["_y"],b2v_btn_target_pos_y,0.5,"easeOutQuart",0.4);
  405. }
  406. function hideBacktoVideoButton()
  407. {
  408.    content_pos_mc.tab_navigation_mc.back_to_video_btn_mc.tween(["_alpha"],0,0.2,"easeOutQuart");
  409.    content_pos_mc.tab_navigation_mc.back_to_video_bg_mc.tween(["_alpha"],0,0.2,"easeOutQuart",0.1);
  410.    clearTimeout(back_to_video_destroy_delay);
  411.    back_to_video_destroy_delay = setTimeout(destroyBacktoVideoButton,350);
  412. }
  413. function destroyBacktoVideoButton()
  414. {
  415.    content_pos_mc.tab_navigation_mc.back_to_video_bg_mc.removeMovieClip();
  416.    content_pos_mc.tab_navigation_mc.back_to_video_btn_mc.removeMovieClip();
  417. }
  418.